<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>快给你的小助手布置任务吧</title>

	<link rel="stylesheet" type="text/css" href="../../css/bootstrap.css">
	<link rel="stylesheet" href="../../layui/css/layui.css" />
	<link rel="stylesheet" href="../../css/font-awesome.min.css">
    <link rel="stylesheet" href="../../css/master.css" />
    <link rel="stylesheet" href="../../css/gloable.css" />
    
	<style>
		.container {
			width: 1000px;
		}

		.commentbox {
			width: 900px;
			margin: 20px auto;
		}

		.mytextarea {
			width: 100%;
			overflow: auto;
			word-break: break-all;
			height: 100px;
			color: #000;
			font-size: 1em;
			resize: none;
		}

		.comment-list {
			width: 900px;
			margin: 20px auto;
			clear: both;
			padding-top: 20px;
		}

		.comment-list .comment-info {
			position: relative;
			margin-bottom: 20px;
			margin-bottom: 20px;
			border-bottom: 1px solid #ccc;
		}

		.comment-list .comment-info header {
			width: 10%;
			position: absolute;
		}

		.comment-list .comment-info header img {
			width: 100%;
			border-radius: 50%;
			padding: 5px;
		}

		.comment-list .comment-info .comment-right {
			padding: 5px 0px 5px 11%;
		}

		.comment-list .comment-info .comment-right h3 {
			margin: 5px 0px;
		}

		.comment-list .comment-info .comment-right .comment-content-header {
			height: 25px;
		}

		.comment-list .comment-info .comment-right .comment-content-header span,
		.comment-list .comment-info .comment-right .comment-content-footer span {
			padding-right: 2em;
			color: #aaa;
		}

		.comment-list .comment-info .comment-right .comment-content-header span,
		.comment-list .comment-info .comment-right .comment-content-footer span.reply-btn,
		.send,
		.reply-list-btn {
			cursor: pointer;
		}

		.comment-list .comment-info .comment-right .reply-list {
			border-left: 3px solid #ccc;
			padding-left: 7px;
		}

		.comment-list .comment-info .comment-right .reply-list .reply {
			border-bottom: 1px dashed #ccc;
		}

		.comment-list .comment-info .comment-right .reply-list .reply div span {
			padding-left: 10px;
		}

		.comment-list .comment-info .comment-right .reply-list .reply p span {
			padding-right: 2em;
			color: #aaa;
		}
		.box {
				width: 800px;
				margin: 30px 400px;
				height: 34px;
				text-align: center;
			}
			
			.page {
				width: 600px;
			}
			
			.info {
				width: 200px;
				height: 34px;
				line-height: 34px;
			}
			
			.fl {
				float: left;
			}
	</style>
</head>

<body>

	<div class="container">
		<!--<div class="commentbox">
			<textarea cols="80" rows="50" placeholder="来说几句吧......" class="mytextarea" id="content"></textarea>
			<div class="btn btn-info pull-right" id="comment">评论</div>
		</div>-->
		<div class="container-inner">
			<div class="commentbox">
			<section class="msg-remark">
				<h1>任务模块</h1>
				<p>
					快给你的小助手布置任务吧
				</p>
			</section>
			<div class="textarea-wrap message" id="textarea-wrap">
				<form class="layui-form blog-editor" action="">
					<div class="layui-form">
						<textarea name="editorContent" lay-verify="content" id="contents" placeholder="请输入内容" class="layui-textarea layui-hide"></textarea>
					</div>
					<div class="layui-form-item">
						<button class="layui-btn" lay-submit="formLeaveMessage" lay-filter="formLeaveMessage" id="comment">提交留言</button>
					</div>
				</form>
			</div>
		</div>
	</div>
		<div class="comment-list">
	
		</div>
		<div class="box">
			<div id="pagination1" class="page fl"></div>
		</div>
	</div>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript" src="../../js/gloable.js"></script>
	<script type="text/javascript" src="../../js/nprogress.js"></script>
	<script>NProgress.start();</script>
	<script type="text/javascript" src="../../js/pagemessageothers.js"></script>
	<script>NProgress.start();</script>
	<script> 
        window.onload = function () {
            NProgress.done();
        };
    </script>
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.commentother.js"></script>
	<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
	
	<script type="text/javascript">
		//初始化数据
		/*var arr = [
			{id:1,img:"../images/img.jpg",replyName:"帅大叔",beReplyName:"匿名",content:"看到这次的特训班名单，我好伤心啊，又没有我的名字，我马上就要毕业了，哭哭",time:"2017-10-17 11:42:53",address:"深圳",osname:"",browse:"谷歌",replyBody:[]},
			{id:2,img:"../images/img.jpg",replyName:"匿名",beReplyName:"",content:"作为一个毕业的老师兄，给师弟师妹一句话：好好读书，珍惜特训班的时光",time:"2017-10-17 11:42:53",address:"深圳",osname:"",browse:"谷歌",replyBody:[{id:1,img:"",replyName:"帅大叔",beReplyName:"匿名",content:"来啊，我们一起吃鸡",time:"2017-10-17 11:42:53",address:"",osname:"",browse:"谷歌"},{id:2,img:"",replyName:"帅大叔",beReplyName:"匿名",content:"来啊，我们一起吃鸡",time:"2017-10-17 11:42:53",address:"",osname:"",browse:"谷歌"}]},
			{id:3,img:"../images/img.jpg",replyName:"帅大叔",beReplyName:"匿名",content:"看到这群特训班的小崽子们，越来越优秀了，我很是欣慰。",time:"2017-10-17 11:42:53",address:"深圳",osname:"win10",browse:"谷歌",replyBody:[]}
		];
	*/
		function getNowDateFormat() {
			var nowDate = new Date();
			var year = nowDate.getFullYear();
			var month = filterNum(nowDate.getMonth() + 1);
			var day = filterNum(nowDate.getDate());
			var hours = filterNum(nowDate.getHours());
			var min = filterNum(nowDate.getMinutes());
			var seconds = filterNum(nowDate.getSeconds());
			return year + "-" + month + "-" + day + " " + hours + ":" + min + ":" + seconds;
		}

		function filterNum(num) {
			if (num < 10) {
				return "0" + num;
			} else {
				return num;
			}
		}
		layui.use('layer', function () {
			layer = layui.layer;
			$ = layui.jquery;
			
		});

		window.onload = function () {
			var code = localStorage.getItem("admin");
			var CourseCode = localStorage.getItem("CourseCode");
			console.log(code)
			$.ajax({
				url: "http://127.0.0.1:8000/Teacherquiz",
				type: "post",
				dataType: "JSON",
				data: {"code":code,'CourseCode':CourseCode},
				async: false,
				success: function (res) {
					$(".comment-list").addCommentList({ data: res, add: "" });
					console.log(res)
				}
			})
			
		}
		$("#comment").click(function () {
		});
	</script>
	<link rel="stylesheet" href="../../css/jquery.pagination.css" />
		<script src="../../js/jquery.pagination.min.js"></script>
	<script>
		$(function() {

			$("#getPage").on("click", function() {
				var info = $("#pagination3").pagination("getPage");
				alert("当前页数：" + info.current + ",总页数：" + info.total);
			});
	
			$("#setPage").on("click", function() {
				$("#pagination3").pagination("setPage", 1, 10);
			});
		});
	</script>
</body>

</html>